Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update cached setting immediately at the time of updating the db #32742

Merged
merged 30 commits into from
Jul 20, 2024

Conversation

debdutdeb
Copy link
Member

@debdutdeb debdutdeb commented Jul 8, 2024

Proposed changes (including videos or screenshots)

Issue(s)

https://rocketchat.atlassian.net/browse/CORE-545

Steps to test or reproduce

Further comments

Copy link

changeset-bot bot commented Jul 8, 2024

🦋 Changeset detected

Latest commit: 8931608

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 32 packages
Name Type
@rocket.chat/meteor Minor
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/gazzodown Major
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts Major
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/api-client Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/ddp-client Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/models Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-client Major
@rocket.chat/ui-video-conf Major
@rocket.chat/web-ui-registration Major
@rocket.chat/instance-status Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

dionisio-bot bot commented Jul 8, 2024

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

Copy link

codecov bot commented Jul 12, 2024

Codecov Report

Attention: Patch coverage is 70.58824% with 5 lines in your changes missing coverage. Please review.

Project coverage is 55.54%. Comparing base (47819cd) to head (8931608).
Report is 5 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #32742   +/-   ##
========================================
  Coverage    55.54%   55.54%           
========================================
  Files         2634     2634           
  Lines        57248    57274   +26     
  Branches     11853    11864   +11     
========================================
+ Hits         31797    31815   +18     
- Misses       22757    22760    +3     
- Partials      2694     2699    +5     
Flag Coverage Δ
e2e 54.28% <ø> (+<0.01%) ⬆️
unit 72.27% <70.58%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@casalsgh casalsgh added this to the 6.11 milestone Jul 12, 2024
@debdutdeb debdutdeb changed the title fix: use correct setting object for cache when not actually overwritten regression: use correct setting object for cache when not actually overwritten Jul 15, 2024
@debdutdeb debdutdeb marked this pull request as ready for review July 17, 2024 05:48
@debdutdeb debdutdeb requested a review from a team as a code owner July 17, 2024 05:48
@debdutdeb debdutdeb requested a review from KevLehman July 17, 2024 05:48
@casalsgh casalsgh requested a review from MarcosSpessatto July 17, 2024 12:15
Copy link
Member

@ggazzo ggazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO too many modifications to a simple regression. the fix/regression has by far more changes than the original fix.

To be honest, I can't understand exactly what error is being corrected. I didn't find explanations in the task or in the pull request. It seems to me that the original correction was not so correct?

The only thing that catches my attention is the

const settingFromCodeOverwritten = overwriteSetting(settingFromCode);
const settingOverwrittenDefault = overrideSetting(settingFromCode);

and then

const updatedSettingAfterApplyingOverwritten = isOverwritten ? settingFromCodeOverwritten : settingOverwrittenDefault;

In my idea, both should have the same value

I would like to see a revert of what was done and the same correction again on top of the original code, this way the original code is completely modified, to the point that I no longer remember that we wanted to update the cache at the time of the overwrite

apps/meteor/app/settings/server/SettingsRegistry.ts Outdated Show resolved Hide resolved
apps/meteor/app/settings/server/SettingsRegistry.ts Outdated Show resolved Hide resolved
apps/meteor/app/settings/server/SettingsRegistry.ts Outdated Show resolved Hide resolved
apps/meteor/app/settings/server/SettingsRegistry.ts Outdated Show resolved Hide resolved
apps/meteor/app/settings/server/SettingsRegistry.ts Outdated Show resolved Hide resolved
apps/meteor/app/settings/server/SettingsRegistry.ts Outdated Show resolved Hide resolved
Co-authored-by: Kevin Aleman <kaleman960@gmail.com>
@debdutdeb debdutdeb changed the base branch from develop to revert-06707d8 July 17, 2024 14:03
@debdutdeb debdutdeb changed the base branch from revert-06707d8 to develop July 17, 2024 14:04
@debdutdeb
Copy link
Member Author

@ggazzo @KevLehman #32814

@debdutdeb debdutdeb changed the title regression: use correct setting object for cache when not actually overwritten fix: update cached setting immediately at the time of updating the db Jul 19, 2024
@debdutdeb debdutdeb force-pushed the fix-incorrect-cache-set branch from 0a0a629 to 88ae469 Compare July 19, 2024 16:25
* test: cached settings expecting delay because changestream

* test: change update test to not expect delays (expect to fail)

* fix: change `SettingsRegistry` to update immediately
@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Jul 19, 2024
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Jul 19, 2024
@ggazzo ggazzo removed the request for review from MarcosSpessatto July 19, 2024 21:13
@ggazzo ggazzo merged commit d4d1445 into develop Jul 20, 2024
52 checks passed
@ggazzo ggazzo deleted the fix-incorrect-cache-set branch July 20, 2024 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants